package com.gzhu.knowledgeAdmin.common.utils;
import com.gzhu.knowledgeAdmin.entity.BasePage;

public class PageableUtil {

    public static void setupPageable(BasePage basePage, Integer PageSize) {
        if (basePage.getPageNum() == null) {
            basePage.setPageNum(0);
        }
        if (basePage.getPageSize() == null) {
            basePage.setPageSize(PageSize);
        }
        Integer pageNumber = PageNumberUtil.getPageNumber(basePage.getPageNum(), basePage.getPageSize());
        basePage.setPageNum(pageNumber);
    }
}
